package com.yiboshi.rehrs.job;

import cn.hutool.core.lang.Pair;
import com.alibaba.fastjson.JSONArray;
import com.yiboshi.rehrs.domain.entity.ZhongUser;
import com.yiboshi.rehrs.domain.entity.ZhongUserImage;
import com.yiboshi.rehrs.domain.service.IZhongUserImageService;
import com.yiboshi.rehrs.domain.service.IZhongUserService;
import com.yiboshi.rehrs.helper.HelperDaxiang;
import com.yiboshi.rehrs.manager.ZhongYouManager;
import com.yiboshi.rehrs.param.ZhongReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author jack 2025/4/9
 */
@Profile({
        "dev"
})
@Component
@Slf4j
public class TestJob {

    @Autowired
    HelperDaxiang helperDaxiang;
    @Autowired
    IZhongUserService zhongUserService;

    @Autowired
    IZhongUserImageService zhongUserImageService;

   @Autowired
   ZhongYouManager zhongYouManager;

    //@Scheduled(cron = "0 * * * * ?")//0 0 0/1 * * ?
    public void run() {
        String account = "2153011500166";
        ZhongUser zhongUser = zhongUserService.one(account);
        ZhongUserImage userImage = zhongUserImageService.getOne(account);
        Pair<ZhongUser, String> pair = zhongYouManager.logonByFace(zhongUser, userImage.getImage());
        ZhongUser zhongUserLogin = pair.getKey();
        String value = pair.getValue();
        log.info("value:{}",value);


        JSONArray jsonArray = zhongYouManager.findpdasignWaybillinfoNew(zhongUserLogin,null);
        log.info("findpdasignWaybillinfoNew:{}",jsonArray);


        //zhongYouManager.queryWaybill()
    }
}
